import axios from 'axios'

export const postRequest = (url,params) =>{
  return axios({
    method:'post',
    url:url,
    data:params,
    headers:{
      'Content-Type':'application/json'
    }
    // transformRequest:[function(data){
    //   let ret = ''
    //   for (let it in data){
    //     ret += encodeURIComponent(it)+ '=' + encodeURIComponent((data[it])) + '&'
    //   }
    //   return ret
    // }],
  })
}

export const getRequest = (url,params) =>{
  return axios({
    method:'get',
    url:url,
    data:params,
    // transformRequest:[function(data){
    //   let ret = ''
    //   for (let it in data){
    //     ret += encodeURIComponent(it)+ '=' + encodeURIComponent((data[it])) + '&'
    //   }
    //   return ret
    // }],
  })
}
